<!DOCTYPE html>
<html lang="zh-CN">
<head>
    {% load static from staticfiles %}
    <meta charset="UTF-8">
    <title>{{website_info.title}}</title>
    <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1,  minimum-scale=1, maximum-scale=1,user-scalable=no">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <link href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
    <link href="http://cdn.bootcss.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

    <link rel="stylesheet" href="{% static "javascript/layerslider/css/layerslider.css" %}"/>
    <link rel="stylesheet" href="{% static "javascript/owl/owl.carousel.css" %}"/>
    <link href="{% static "css/style.css" %}" rel="stylesheet">
    <link rel="stylesheet" href="{% static "javascript/layerslider/skins/v5/skin.css" %}"/>
    <script src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    <script src="{%static "javascript/layerslider/js/greensock.js" %}"></script>
    <script src="{%static "javascript/layerslider/js/layerslider.kreaturamedia.jquery.js" %}"></script>
    <script src="{%static "javascript/layerslider/js/layerslider.transitions.js" %}"></script>
    <script src="{%static "javascript/owl/owl.carousel.min.js" %}"></script>
    <script src="{%static "javascript/jwplayer/jwplayer.js" %}"></script>
    {%block head%} {% endblock %}

</head>


<body>
<div>
    <!-- 导航栏 网站顶部-->
    {% include "./include/nav.html"%}

    {% include "./include/carousel.html"%}
    <!-- 首页展示 -->
    <div class="content">
        <div class="container">
            {%block main%} {% endblock %}
        </div>
    <!-- 脚部-->
    {% include "./include/footer.html"%}
    </div>

</div>
</body>

<script>
    $(function() {
        if(!$('.h-n-small').is(':hidden')) {
            $('.h-n-s-title p').bind('click', function () {
                $('.h-n-small ul').slideToggle(500);
            });
        }
        //幻灯片
        $("#layerslider").layerSlider({
            pauseOnHover: true,
            responsive: false,
            responsiveUnder: 1920,
            layersContainer: 1920,
            navPrevNext: true,
            navStartStop: false,
            navButtons: true,
            showBarTimer: true,
            showCircleTimer: false,
            tnWidth: 100,
            tnActiveOpacity: 10,
            hoverBottomNav: true,
            globalBGColor: '#fff',
            towWaySlideshow: true,
            autoStart: true,
            skinsPath: '/static/javascript/layerslider/skins/',
            skin: 'v5'
        });
        //选项卡
        $('.c-e-lists li').hover(function(){
           $(this).addClass('active').siblings().removeClass('active');
            var _index = $(this).index(),_width = $('.c-e-main').height();
            $('.c-e-m-animate').animate({marginTop: - _index * _width},200, 'swing');
        });
        //焦点图
        if(!$('#owlcarousel').is(':hidden')) {
            $('#owlcarousel').owlCarousel({
                items: 1,
                itemsDesktop: [1000, 1], // between 1000px and 901px
                itemsDesktopSmall: [900, 1], // betweem 900px and 601px
                itemsTablet: [600, 1], // between 600 and 0
                autoPlay: 6000,
                navigation: true,
                pagination: false,
                paginationSpeed: 800,
                rewindSpeed: 800,
                slideSpeed: 800
            });
        }
        //视频
        if(!$('.c-n-flash').is(':hidden')){
            jwplayer('c-n-flash').setup({
                'flashplayer': '/static/jwplayer/jwplayer.flash.swf',
                'image': '/static/images/news-lists-first.jpg',
                'id': 'playerID',
                'width': '100%',
                'aspectratio':'10:8',
                'file': '/static/video/video.mp4'
            });
        }
        //产品
        if(!$('#c-p-lists').is(':hidden')) {
            $('#c-p-lists').owlCarousel({
                items: 4,
                itemsDesktop: [1000, 1], // between 1000px and 901px
                itemsDesktopSmall: [900, 3], // betweem 900px and 601px
                itemsTablet: [600, 1], // between 600 and 0
                autoPlay: false,
                navigation: true,
                pagination: true,
                paginationSpeed: 800,
                rewindSpeed: 800,
                slideSpeed: 800
            });
        }
        //cookie
        $('.eng-cookie a').bind('click', function(){
            var _cookie = getCookie("language"),
                _language = $(this).text();
            if( _language == 'English'){
                $(this).text('Chinese');
                setCookie("language", "English", 10);
                location.href = "/";
            } else if(_language == 'Chinese') {
                $(this).text('English');
                setCookie("language", "Chinese", 10);
                location.href = "/";
            }
        });
        function setCookie(name, value, expiredays) {
            var ExpireDate = new Date();
            ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 60 * 1000));
            document.cookie = name + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString()) + "; path=/";
        }
        //获取cookie
        function getCookie(name) {
            var strCookie = document.cookie;
            var arrCookie = strCookie.split(";");
            for (var i = 0; i < arrCookie.length; i++) {
                var arr = arrCookie[i].split("=");
                if (arr[0] == name) return arr[1];
            }
            return null;
        }
    });
</script>


</html>
